<#assign base = req.contextPath/>
<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1"/>
    <meta name="renderer" content="webkit"/>
    <link rel="icon" href="/static/favicon.ico"/>
    <title>优惠券折扣购物 - 够优折</title>
    <meta name="Keywords" content="优惠券折扣,9块9包邮,限时特卖,优品折扣,够优折"/>
    <meta name="Description" content="优惠券折扣直播第一站！每天更新千款，纯人工筛选验货，限时限量特卖，全场1折包邮！"/>
    <link rel="stylesheet" type="text/css" href="/static/css/main.css"/>
    <link rel="stylesheet" type="text/css" href="/static/plugins/autocompleter/jquery.autocompleter.css"/>
</head>
<body>
<div id="navTop">
    <div id="top">
    <#--<div id="topleft" style="margin: 0;line-height: 25px;">-->
    <#--亲爱的，来加粉丝专享优惠QQ群-->
    <#--<a target="_blank" style="height: 22px;float: right;" href="http://www.qingtaoke.com">-->
    <#--<img border="0"-->
    <#--src="https://img.alicdn.com/imgextra/i1/2508158775/TB2SfmWqFXXXXb4XpXXXXXXXXXX_!!2508158775.png">-->
    <#--</a>-->
    <#--</div>-->
        <ul id="topright" style="line-height: 25px;">
            <li style=" margin-right: 8px;">
                <a href="javascript:void(0)" onclick="SetHome(this,window.location)" style="color: #757575"
                   title="将本站设为首页">
                    设为首页
                </a>
            </li>
            <li style="margin-right: 8px;"><a
                    href="javascript:void(0)" onclick="shoucang(document.title,window.location)" style="color: #757575"
                    title="加入收藏，方便下次打开">加入收藏</a>
            </li>
            <li><a target="_blank"
                   href="http://wpa.qq.com/msgrd?v=3&uin=123124&site=qq&menu=yes"
                   style="color: #8da7cb" title="联系我帮你解答">遇到购物问题? 联系我 ></a>
            </li>
        </ul>
        <div class="clear"></div>
    </div>
</div>

<div id="headNav">
    <div id="header">
        <a id="logo" class="cnzzCounter" href="/"></a>

        <div id="search">
            <form action="/">
                <input class="searchInput" type="text" value="${keyword}"
                       name="kw" placeholder="好宝贝 等你搜"/>
                <button type="submit" class="cnzzCounter"></button>
            </form>
        </div>
        <div class="showChar">
            <div class="showChar-div showChar-3 right">
                <i></i>
                <span>验货保障</span>
            </div>
            <div class="showChar-div showChar-2">
                <i></i>
                <span>买手砍价</span>
            </div>
        <#--<div class="showChar-div showChar-1">-->
        <#--<i></i>-->
        <#--<span>9:00开抢</span>-->
        <#--</div>-->
        </div>
        <div class="clear"></div>
    </div>
</div>

<div id="baner">
    <div id="nav">
        <#list categorys as cat>
        <a href="/${cat.code}" class="cnzzCounter iconH <#if pagekey==cat.code>active</#if>">${cat.name}</a>
        </#list>
        <a id="navFeedback" style="float: right;width: auto;font-size: 12px;line-height: 46px;">意见反馈<img
                src="/static/images/feedback.png" alt="" style="width:12px;"></a>
    </div>
</div>

<div id="feedback" class="feedback">
    <div style="text-align:center;">
        <div class="line">
            <h1 class="feedback-title">意见反馈</h1>
        </div>
        <div class="line">
            <p>感谢您对我们的支持，您的建议我们会认真采纳并不断优化，为您提供更好的服务和体验！</p>
        </div>
        <div class="line">
            <textarea id="feedbackContent" rows="10" maxlength="400" placeholder="请输入您的建议或遇到的问题"></textarea><br/>
        </div>
        <div class="line">
            <input id="feedbackContact" maxlength="40" placeholder="请优先填写QQ号码，方便在线联系"/><br/>
        </div>
        <div class="line">
            <button id="feedbackSubmit">提交</button>
        </div>
    </div>
</div>
<div id="feedbackSuccess" class="feedback">
    <div class="feedback-content" style="text-align:center;">
        <div class="line">
            <h1 class="feedback-title">提交成功</h1>
        </div>
        <div class="line">
            <p>感谢您对我们的反馈，对您给予的帮助和支持我们深表感谢！</p>
        </div>
        <div class="line">
            <button id="feedbackClose">关闭</button>
        </div>
    </div>
</div>
<!--浮动顶部-->
<div class="fixedHead-box">
    <div class="fixedHead">
        <div class="fixedHead-nav">
            <#list categorys as cat>
                <span class="cate <#if pagekey==cat.code>on</#if>">
                    <a href="/${cat.code}" class="cnzzCounter">${cat.name}<i></i></a>
                </span>
            </#list>
        </div>
        <div class="fixedHead-search" id="fixedSearch">
            <form action="/">
                <input class="searchInput" type="text" value="${keyword}"
                       name="kw" placeholder="好宝贝 等你搜"/>
                <button type="submit" class="cnzzCounter"></button>
            </form>
        </div>
    </div>
    <div class="clearfix"></div>
</div>


<div id="dtk_mian">

    <style type="text/css">
        .g_over {
            border: 1px solid #F3E9EC;
        }

        .g_over:hover, .g_over:focus {
            border: 1px solid #de366e;
        }
    </style>
    <div class="search-wrap main-container">
        <img src="https://img.alicdn.com/imgextra/i2/847774267/TB2dWOvbTcCL1FjSZFPXXXZgpXa_!!847774267.png?v=20170714007"
             alt="">
    </div>

    <div class="cat-wrap main-container">
        <#if keyword?length<1>
        <div class="cat-list clearfix">
            <span class="cat-lit-title">商品分类</span>
            <ul class="clearfix">
                <li <#if currentGoodColumn == "all">class="active"</#if>>
                    <a href="/${pagekey}" class="cnzzCounter">全部优惠<b>(${(goodColumnMap.all)?default(0)?c})</b></a>
                </li>
                <li <#if currentGoodColumn == "nvz"> class="active"</#if>>
                    <a href="/${pagekey}/nvz" class="cnzzCounter">女装<b>(${(goodColumnMap.nvz)?default(0)?c})</b></a>
                </li>
                <li <#if currentGoodColumn == "ny"> class="active"</#if>>
                    <a href="/${pagekey}/ny" class="cnzzCounter">内衣<b>(${(goodColumnMap.ny)?default(0)?c})</b></a>
                </li>
                <li <#if currentGoodColumn == "nz"> class="active"</#if>>
                    <a href="/${pagekey}/nz" class="cnzzCounter">男装<b>(${(goodColumnMap.nz)?default(0)?c})</b></a>
                </li>
                <li <#if currentGoodColumn == "my"> class="active"</#if>>
                    <a href="/${pagekey}/my" class="cnzzCounter">母婴<b>(${(goodColumnMap.my)?default(0)?c})</b></a>
                </li>
                <li <#if currentGoodColumn == "hzp"> class="active"</#if>>
                    <a href="/${pagekey}/hzp" class="cnzzCounter">化妆品<b>(${(goodColumnMap.hzp)?default(0)?c})</b></a>
                </li>
                <li <#if currentGoodColumn == "jj"> class="active"</#if>>
                    <a href="/${pagekey}/jj" class="cnzzCounter">居家<b>(${(goodColumnMap.jj)?default(0)?c})</b></a>
                </li>
                <li <#if currentGoodColumn == "xbps"> class="active"</#if>>
                    <a href="/${pagekey}/xbps" class="cnzzCounter">鞋包配饰<b>(${(goodColumnMap.xbps)?default(0)?c})</b></a>
                </li>
                <li <#if currentGoodColumn == "ms"> class="active"</#if>>
                    <a href="/${pagekey}/ms" class="cnzzCounter">美食<b>(${(goodColumnMap.ms)?default(0)?c})</b></a>
                </li>
                <li <#if currentGoodColumn == "wtcp"> class="active"</#if>>
                    <a href="/${pagekey}/wtcp" class="cnzzCounter">文体车品<b>(${(goodColumnMap.wtcp)?default(0)?c})</b></a>
                </li>
                <li <#if currentGoodColumn == "smjd"> class="active"</#if>>
                    <a href="/${pagekey}/smjd" class="cnzzCounter">数码家电<b>(${(goodColumnMap.smjd)?default(0)?c})</b></a>
                </li>
            </ul>
        </div>
        </#if>
        <div class="cat-list sale-type clearfix">
            <span class="cat-lit-title">促销类型</span>
            <ul class="clearfix">
                <li class="<#if type == 0>active</#if>">
                    <a href="${currentUri}${haskeyword?string("?kw="+keyword,"")}"><i></i>全部</a>
                </li>
                <li class="<#if type == 1>active</#if>">
                    <a href="${currentUri}?type=1${(type!=0&&keyword?length>1)?string("&kw="+keyword,"")}${(haquery&&keyword?length>1)?string("?kw="+keyword,"")}"><i></i>天猫</a>
                </li>
                <li class="<#if type == 2>active</#if>">
                    <a href="${currentUri}?type=2${(type!=0&&keyword?length>1)?string("&kw="+keyword,"")}${(haquery&&keyword?length>1)?string("?kw="+keyword,"")}"><i></i>淘宝</a>
                </li>
            </ul>
        </div>
        <div class="tag-wrap main-container clearfix cat-wrap">
            <div class="fixed-wrap fl">
                <a href="${currentUri}${(type == 0)?string("","?type="+type)}${(type!=0&&keyword?length>1)?string("&kw="+keyword,"")}${(type==0&&keyword?length>1)?string("?kw="+keyword,"")}"
                   class="tag-fixed <#if sort == "n">active</#if>">最新</a>
                <a href="${currentUri}?sort=s${(type == 0)?string("","&type="+type)}${haskeyword?string("&kw="+keyword,"")}"
                   class="tag-fixed <#if sort == "s">active</#if>">销量</a>
                <a href="${currentUri}?sort=p${(type == 0)?string("","&type="+type)}${haskeyword?string("&kw="+keyword,"")}"
                   class="tag-fixed <#if sort == "p">active</#if>">价格从低到高</a>


            <#--<div class="sort-price-area fl">-->
            <#--<form action="/index.php?r=l&cid=0&kw=&s=r&min=0&max=0&seckill=0&jipin=0&tmall=0&u=1&pv=7"-->
            <#--onsubmit="var param = $(this).serialize();window.location.href = $(this).prop('action')+'&'+param;return false;">-->
            <#--<input class="min-price" onkeyup="this.value=this.value.replace(/[^\-?\d.]/g,'')" id="min"-->
            <#--name="min" value="" placeholder="￥">-->
            <#--<span>-</span>-->
            <#--<input class="max-price" onkeyup="this.value=this.value.replace(/[^\-?\d.]/g,'')" id="max"-->
            <#--name="max" value="" placeholder="￥">-->
            <#--<button>确定</button>-->
            <#--</form>-->
            <#--</div>-->
            </div>
            <div class="goods-pages-page clearfix" style="">
                <span class="pagebtn pre-page <#if result.currentPage lte 1>disabled</#if>">
                <#if result.currentPage gt 1>
                    <a href="${currentUrl}${haquery?string("&","?")}page=${(result.currentPage-1)?c}"> </a>
                </#if>
                </span>
                <span class="page-num">
                    <b>${(result.currentPage)?c}</b>/${(result.totalPage)?c}
                </span>
                <span class="pagebtn  next-page <#if result.currentPage gte result.totalPage>disabled</#if>">
                <#if result.currentPage lt result.totalPage>
                    <a href="${currentUrl}${haquery?string("&","?")}page=${(result.currentPage+1)?c}"></a>
                </#if>
                </span>
            </div>
        </div>
        <div class="goods-list main-container" style="overflow:hidden;">
        <#if result.total lte 0>
            <div class="search-no-data">
                <i></i>
                <div>暂时无商品可推荐请稍后</div>
            </div>
        <#else>
            <ul class="clearfix">
                <#list result.data as good>
                    <li class=" g_over">
                        <a href="#" targetId="${good.goodId}" couponId="${(good.couponId)?default("")}"
                           title="${good.title}"
                           class="img goodLinkA"
                           target="_blank">
                            <img data-original="${good.pic}_310x310.jpg" alt="${good.title}" _hover-ignore="1">
                        </a>
                        <div class="goods-padding">
                            <div class="coupon-wrap clearfix">
                                <span class="price"><em>券后</em><b><i>￥</i>${good.price - good.couponPrice}</b></span>
                                <span class="old-price"><i>￥</i>${good.price}</span>
                                <span class="coupon">
                            <i class="coupon-txt">券</i>
                            <b>
                                <i>￥</i>${good.couponPrice}
                            </b>
                        </span>
                            </div>
                            <div class="title">
                                <a class="goodLinkA" target="_blank"
                                   href="#" targetId="${good.goodId}" title="${good.title}">${good.title}</a>
                            </div>
                            <div class="goods-num-type">
                                <span class="goods-num">销量<b _hover-ignore="1">${good.sellNum}</b></span>
                                <div class="goods-type">
                                    <#if good.tmall == 1>
                                        <i class="tmall" title="天猫"></i>
                                    </#if>
                                </div>
                            </div>
                        </div>
                        <div class="act">
                            <a class="quan-btn goodLinkA" rel="nofollow" href="#"
                               targetId="${good.goodId}" target="_blank"
                               style="width:100%">领券下单</a>
                        </div>
                    </li>
                </#list>
            </ul>
        </#if>
        </div>
    <#if result.total?default(0) gte 1>
        <div class="pager main-container" style="margin: 20px auto;">
            <div id="yw0" class="pager">
                <#if result.currentPage?default(1) lte 1>
                    <a class="pre-page disabled" href="javascript:void(0);">上一页</a>
                <#else>
                    <a class="pre-page" href=".?page=${result.currentPage-1}">上一页</a>
                </#if>

                <#if (result.totalPage lte 7) && (result.totalPage gt 0)>
                    <#list 1..result.totalPage as page>
                        <#if  result.currentPage == page>
                            <a class="item cur" href="javascript:void(0);">${page?c}</a>
                        <#else>
                            <a class="item" href="${currentUrl}${haquery?string("&","?")}page=${page?c}">${page?c}</a>
                        </#if>
                    </#list>
                <#else>
                    <#if (result.currentPage - 3) lte 1>
                        <#if result.currentPage == 1>
                            <a class="item cur" href="javascript:void(0);">1</a>
                        <#else>
                            <a class="item" href="${currentUrl}${haquery?string("&","?")}page=1">1</a>
                        </#if>
                    <#else>
                        <a class="item" href="${currentUrl}${haquery?string("&","?")}page=1">1</a>
                        <a class="item more" href="javascript:void(0);">...</a>
                    </#if>

                    <#if (result.currentPage gte 5) && (result.currentPage lte (result.totalPage-4))>
                        <#list result.currentPage-2..result.currentPage+2 as page>
                            <#if result.currentPage == page>
                                <a class="item cur" href="javascript:void(0);">${page?c}</a>
                            <#else>
                                <a class="item"
                                   href="${currentUrl}${haquery?string("&","?")}page=${page?c}">${page?c}</a>
                            </#if>
                        </#list>
                    <#elseif result.currentPage lt 5>
                        <#list 2..6 as page>
                            <#if result.currentPage == page>
                                <a class="item cur" href="javascript:void(0);">${page?c}</a>
                            <#else>
                                <a class="item"
                                   href="${currentUrl}${haquery?string("&","?")}page=${page?c}">${page?c}</a>
                            </#if>
                        </#list>
                    <#else>
                        <#list result.totalPage-5..result.totalPage-1 as page>
                            <#if result.currentPage == page>
                                <a class="item cur" href="javascript:void(0);">${page?c}</a>
                            <#else>
                                <a class="item"
                                   href="${currentUrl}${haquery?string("&","?")}page=${page?c}">${page?c}</a>
                            </#if>
                        </#list>
                    </#if>
                </#if>

                <#if (result.totalPage gte 7) &&(result.currentPage+2 lt (result.totalPage - 1))>
                    <a class="item more" href="javascript:void(0);">...</a>
                    <a class="item"
                       href="${currentUrl}${haquery?string("&","?")}page=${(result.totalPage)?c}">${(result.totalPage)?c}</a>
                <#else>
                    <#if result.totalPage gt 7>
                        <#if result.currentPage == result.totalPage>
                            <a class="item cur" href="javascript:void(0);">${(result.totalPage)?c}</a>
                        <#else>
                            <a class="item"
                               href="${currentUrl}${haquery?string("&","?")}page=${(result.totalPage)?c}">${(result.totalPage)?c}</a>
                        </#if>
                    </#if>
                </#if>

                <#if result.currentPage lt result.totalPage>
                    <a class="next-page"
                       href="${currentUrl}${haquery?string("&","?")}page=${(result.currentPage+1)?c}">下一页</a>
                <#else>
                    <a class="next-page disabled" href="javascript:void(0);">下一页</a>
                </#if>
            </div>
        </div>
    </#if>
    </div>
</div>
<div id="footer">
    <div class="footer-wrapper">
        <img src="/static/images/bottom_text.png" alt="">
        <div class="author">
            by&nbsp;&nbsp;够优折
        </div>
        <div class="text">
            &copy; CopyRight&nbsp;2017 &nbsp;
            <a href="https://www.gyouzhe.club" target="_blank" rel="nofollow">够优折</a>
            &nbsp;https://www.gyouzhe.club&nbsp;&nbsp;
            <a href="http://www.miitbeian.gov.cn/" target="_blank" rel="nofollow">蜀ICP备17042188号</a>
            &nbsp;&nbsp;
        </div>
    </div>
</div>
<div class="toTop" style="display: none">
    <span>回到顶部</span>
</div>

<script src="https://cdn.bootcss.com/jquery/1.10.0/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/jquery_lazyload/1.9.7/jquery.lazyload.js"></script>
<script src="/static/plugins/autocompleter/jquery.autocompleter.min.js"></script>
<script src="/static/plugins/layer/layer.js"></script>
<script type="text/javascript">
    var hasClick = false;

    function scollTop() {
        $('body,html').animate({scrollTop: 0}, 1000);
    }

    function showElem() {
        if ($(window).scrollTop() > 168) {
            $(".toTop").stop().fadeIn(200);
            $(".fixedHead-box").slideDown(200);
        } else {
            $(".toTop").stop().fadeOut(200);
            $(".fixedHead-box").slideUp(200);
        }
    }

    //写法1
    function openwin(url) {
        var a = document.createElement("a"); //创建a对象
        a.setAttribute("href", url);
        a.setAttribute("target", "_blank");
        a.setAttribute("id", "camnpr");
        document.body.appendChild(a);
        a.click(); //执行当前对象
    }

    //写法2
    function openUrl(url) {
        var a = $('<a href="' + url + '" target="_blank"></a>')[0];
        var e = document.createEvent('MouseEvents');
        e.initEvent('click', true, true);
        a.dispatchEvent(e);
    }

    function triggerClick(e) {
        e.preventDefault();
        e.stopPropagation();
        if (!hasClick) {
            hasClick = true;
            $.ajax({
                url: '/good/transform.json',
                type: 'post',
                data: {goodId: $(this).attr('targetId'), couponId: $(this).attr('couponId')},
                success: function (data) {
                    if (data.code === 200) {
                        var data = data.data;
                        openUrl(data.extLink);
                    } else {
                        layer.msg('转码链接失败');
                    }
                    setTimeout(function () {
                        hasClick = false;
                    }, 500);
                },
                error: function () {
                    layer.msg('转码链接失败');
                    setTimeout(function () {
                        hasClick = false;
                    }, 500);
                }
            });
        }
    }

    $(function () {
        var regex = /^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\\d{8}$/;
        var qqreg = /[1-9][0-9]{4,14}/;
        $(window).scroll(function () {
            showElem()
        });
        $('.searchInput').autocompleter({source: '/suggest/sug'});
        $('a.img>img').lazyload({
            effect: "fadeIn",
            threshold: 500
        });
        $('a.goodLinkA').bind('click', triggerClick);
        $('.toTop').on('click', scollTop);
        $('#navFeedback').on('click', function () {
            layer.open({
                type: 1,
                //skin:'layui-layer-rim',
                area: [600, 400],
                title: false,
                closeBtn: 1,
                shadeClose: true,
                //btn:['提交'],
                content: $('#feedback')
            });
        });
        $('#feedbackSubmit').on('click', function () {
            var fContent = $('#feedbackContent').val();
            var fContact = $('#feedbackContact').val();
            if (fContent.trim() === '') {
                layer.msg('请留下您的建议', {time: 1500});
                return;
            }
            if (fContent.trim().length > 255) {
                layer.msg('留言内容请小于255个字符', {time: 1500});
                return;
            }
            if (fContact.trim() === '' && (regex.test(fContact) || qqreg.test(fContact))) {
                layer.msg('请留下您的正确的联系方式', {time: 1500});
                return;
            }
            var feedbackSuccess = function (ret) {
                if (ret.code !== 200) {
                    layer.msg(ret.msg);
                } else {
                    layer.closeAll();
                    $('#feedbackContent').val('');
                    $('#feedbackContact').val('');
                    layer.open({
                        type: 1,
                        area: [600, 400],
                        title: false,
                        closeBtn: 0,
                        shadeClose: true,
                        content: $('#feedbackSuccess')
                    });
                }
            };
            $.ajax('/feedback', {
                type: 'post',
                dataType: 'json',
                data: {
                    "content": fContent.trim(),
                    "contact": fContact.trim(),
                },
                error: function (jqXHR, textStatus, errorThrown) {
                    return layer.msg(errorThrown);
                },
                success: feedbackSuccess
            });
        });
        $('#feedbackClose').on('click', function () {
            layer.closeAll();
        });
    });

</script>
<script type="text/javascript">
    var _hmt = _hmt || [];
    (function () {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?6f8ddc30bafae88eb81f6d2e578d52b9";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>
</body>
</html>
